package datastructure.board.elements;

import common.Position;

public class ConveyorBeltElement extends BoardElement{
    public static enum beltDirection {forward, right, left}

    private beltDirection directionOfBelt;
    private boolean expressBelt;

    @Override
    public String toString() {
        return "ConveyorBeltElement[" + getPositionInGrid() + " Direction[" + getDirectionOfBelt() + "] expressBelt[" + isExpressBelt()+ "]]";
    }

    /**
     * Construct a conveyorBelt
     * @param beltPosition the position and direction of the belt
     * @param beltDirection if the belt should turn or be straight
     * @param expressBelt if the belt is an express version which moves 2 spaces
     */
    public ConveyorBeltElement(Position beltPosition, beltDirection beltDirection, boolean expressBelt){
        super(beltPosition);
        this.directionOfBelt = beltDirection;
        this.expressBelt = expressBelt;
    }

    /**
     * Returns whether the belt turns or runs straight
     * @return a direction specified by the enum {@code beltDirection}
     */
    public beltDirection getDirectionOfBelt() {
        return directionOfBelt;
    }

    /**
     * @return whether the belt is an express belt
     */
    public boolean isExpressBelt() {
        return expressBelt;
    }
}
